#ifndef _physicsworld_h__
#define _physicsworld_h__
#include "physicsobject.h"
#include "math/vector.h"
#include "Box2D/Box2D.h"
#include "gtl/list.h"

namespace gecko
{

	// defines a physics world
	class PhysicsWorld
	{
	public:
		// constructor
		PhysicsWorld(const Vector3f & gravity);

		// destructor
		virtual ~PhysicsWorld();

		// step the physics world
		void Update(float dt);

		// draw debug lines
		void RenderDebug();

		// creat a physics object and add it to the world
		PhysicsObject * CreatePhysicsObject(const BodyDef & def, const Vector3f & position);

		// get the Box2D physics world
		b2World * GetBox2DWorld();

	private:
		b2World * m_world;
		typedef gtl::List<PhysicsObject *> PhysicsObjectList;
		PhysicsObjectList m_physicsObjects;
	};

}

#endif